//package com.yksj.healthtalk.ui.salon;
//
//import java.util.ArrayList;
//
//import android.app.Activity;
//import android.app.Dialog;
//import android.content.DialogInterface;
//import android.os.Bundle;
//import android.os.Handler;
//import android.os.Message;
//import android.os.Process;
//import android.view.View;
//import android.view.View.OnClickListener;
//import android.widget.Button;
//import android.widget.EditText;
//import android.widget.ListView;
//
//import com.yksj.healthtalk.adapter.SalonAdapter;
//import com.yksj.healthtalk.entity.SalonEntity;
//import com.yksj.healthtalk.ui.R;
//import com.yksj.healthtalk.utils.DialogUtils;
//import com.yksj.healthtalk.utils.SalonHttpUtil;
//import com.yksj.healthtalk.utils.ToastUtil;
//
///**
//* @ClassName: SalonSearchActivity 
//* @Description: 沙龙搜索
//* @author wangtao wt0710910108_gmail_com  
//* @date 2013-1-4 上午7:10:34
// */
//public class SalonSearchActivity extends Activity implements OnClickListener{
//	
//	private ListView mSearchList;//搜索沙龙列表
//	private Button mTitleBackBtn;
//	private Button mSureBtn;
//	private EditText mSearchEditView;
//	private int page = 1;
//	private int size = 30 ;
//	private final int DATA_LOAD = 000;//读取数据对话框的id
//	private final int DATA_NET_ERROR = -102;//无法连接到服务器
//	private ArrayList<SalonEntity> salonEntities;
//	private SalonAdapter mSalonAdapter;
//	private Handler mHandler;
//	
//	@Override
//	protected void onCreate(Bundle savedInstanceState) {
//		// TODO Auto-generated method stub
//		super.onCreate(savedInstanceState);
//		setContentView(R.layout.salon_search);
//		initWidget();
//		initData();
//	}
//	
//	/**
//	* @Title: initData 
//	* @Description:初始化数据
//	* @param    
//	* @return void  
//	* @throws
//	 */
//	private void initData() {
//		// TODO Auto-generated method stub
//		salonEntities =  new ArrayList<SalonEntity>();
//		
//		mHandler =  new Handler(){
//
//			@Override
//			public void handleMessage(Message msg) {
//				removeDialog(DATA_LOAD);
//				showDialog(DATA_NET_ERROR);
//				super.handleMessage(msg);
//			}
//		};
//	}
//
//	/**
//	* @Title: initWidget 
//	* @Description: 初始化控件
//	* @param    
//	* @return void   
//	* @throws
//	 */
//	private void initWidget() {
//		//获取控件对象
//		mSearchList = (ListView) findViewById(R.id.search_list);
//		mSureBtn = (Button) findViewById(R.id.sure_btn);
//		mTitleBackBtn = (Button)findViewById(R.id.title_back);
//		mSearchEditView = (EditText)findViewById(R.id.search_edit);
//		//设置监听事件
//		mTitleBackBtn.setOnClickListener(this);
//		mSureBtn.setOnClickListener(this);
//	}
//
//	@Override
//	public void onClick(View v) {
//		// TODO Auto-generated method stub
//		switch (v.getId()) {
//		case R.id.title_back:
//			finish();
//			break;
//		case R.id.sure_btn:
//			showDialog(DATA_LOAD);
////			SalonHttpUtil.getSalonInfo(mSearchEditView.getText().toString().trim(), "", page, size, TestUtil.ID, "0", "");
//			//设置网络超时时间
//			mHandler.postDelayed(new Runnable() {
//					
//					@Override
//					public void run() {
//						// TODO Auto-generated method stub
//						mHandler.sendEmptyMessage(0);
//					}
//				}, 15000);
//			break;
//		default:
//			break;
//		}
//	}
//	
//	@Override
//	protected Dialog onCreateDialog(int id) {
//		switch (id) {
//		case DATA_LOAD:
//			return DialogUtils.getLoadingDialog(this, getString(R.string.dataload));
//		case DATA_NET_ERROR://网络出现问题
//			Dialog dialog2 = DialogUtils.getErrorDialog(this,getString(R.string.getway_error),"无法连接服务器~");
//			dialog2.setOnDismissListener(new DialogInterface.OnDismissListener() {
//				@Override
//				public void onDismiss(DialogInterface dialog) {
//					finish();
//					android.os.Process.killProcess(Process.myPid());
//				}
//			}); 
//			return dialog2;
//		}
//		return super.onCreateDialog(id);
//	}
//
////	@Override
////	public void response(int  type, String content) {
////		mHandler.removeMessages(0);
////		if (!content.equals("-1")&&!content.equals("-2")) {
//////			salonEntities .addAll(SalonHttpUtil.jsonAnalysisSalonEntity(content));
////			if (salonEntities.size() == 0) {
////				ToastUtil.showShort(getApplicationContext(), R.string.nosearch);
////			}else {
////				if (mSalonAdapter == null) {
//////					mSalonAdapter = new SalonAdapter(this,salonEntities);
////					mSearchList.setAdapter(mSalonAdapter);
////				}else {
////					mSalonAdapter.notifyDataSetChanged();
////				}
////			}
////			removeDialog(DATA_LOAD);
////		}else if(content.equals("-1")){
////			ToastUtil.showShort(getApplicationContext(), R.string.http_error);
////		}else  if(content.equals("-2")){
////			ToastUtil.showShort(getApplicationContext(), content);
////		}
////	}
//}
